int SystemMonitor::getCpuFrequency()
{
    QFile file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq");
    if (file.open(QIODevice::ReadOnly)) {
        QString content = file.readAll().trimmed();
        file.close();
        
        bool ok;
        int currentFreq = content.toInt(&ok);
        if (ok) {
            return currentFreq / 1000; // 转换为MHz
        }
    }
    return 0;
}